local mushroom_pizza = fk.CreateSkill {
  name = "cf_mushroom_pizza_skill",
}

Fk:loadTranslationTable {
  ["cf_mushroom_pizza_skill"] = "烤蘑菇披萨",
  ["#cf_mushroom_pizza_skill"] = "令一名角色未饱腹的已受伤的角色回复一点体力并饱腹，然后其接下两个结束阶段回复一点体力",
  ["@cf_mushroom_pizza_skill"] = "烤蘑菇披萨",
}

mushroom_pizza:addEffect("cardskill", {
  prompt = "#cf_mushroom_pizza_skill",
  target_num = 1,
  mod_target_filter = function(self, player, to_select, selected, card, extra_data)
    return to_select:getMark("@@cf_baofu-turn") == 0 and to_select:isWounded()
  end,
  target_filter = Util.CardTargetFilter,
  on_effect = function(self, room, effect)
    local to
    local to = effect.to
    if not to:isWounded() and to.dead then return end
    room:recover {
      who = to,
      num = 1,
      card = effect.card,
      recoverBy = effect.from,
      skillName = mushroom_pizza.name
    }
    room:addPlayerMark(to, "@cf_mushroom_pizza_skill", 2)
    room:addPlayerMark(to, "@@cf_baofu-turn")
    if room:hasSkill("cf_mushroom_pizza_coutinue_skill") then return end
    room:addSkill("cf_mushroom_pizza_coutinue_skill")
  end
})

return mushroom_pizza
